"""pytest配置文件"""

import pytest
from fastapi.testclient import TestClient

from app.main import app


@pytest.fixture
def client():
    """FastAPI测试客户端"""
    return TestClient(app)


@pytest.fixture
def test_api_key():
    """测试API密钥"""
    return "demo-api-key"


@pytest.fixture
def auth_headers(test_api_key):
    """认证头部"""
    return {
        "Authorization": f"Bearer {test_api_key}",
        "Content-Type": "application/json"
    }


@pytest.fixture
def sample_text():
    """示例文本"""
    return "这是一段用于测试的文本内容。它包含了足够的字符来满足最小长度要求，并且可以用于各种测试场景。"


@pytest.fixture
def sample_detection_request():
    """示例检测请求"""
    return {
        "text": "这是一段用于测试的文本内容。它包含了足够的字符来满足最小长度要求，并且可以用于各种测试场景。",
        "platform": "zhiwang",
        "title": "测试文档",
        "author": "测试作者"
    } 